Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite pipeline selection to serially build cluster #266

Merged
merged 4 commits into from
Jul 7, 2023
Merged

Conversation

allenporter
Copy link
Owner

@allenporter allenporter commented Jul 7, 2023

This is an overhaul to simplify the algorithm at the expense of speed. This makes handles more complex cluster setups that the old algorithm couldn't reason about.

Issue #198

Repository owner deleted a comment from github-actions bot Jul 7, 2023
Repository owner deleted a comment from github-actions bot Jul 7, 2023
Repository owner deleted a comment from github-actions bot Jul 7, 2023
Repository owner deleted a comment from github-actions bot Jul 7, 2023
Repository owner deleted a comment from github-actions bot Jul 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

--- tests/testdata/cluster3/tenants/overlays/cluster3 Kustomization: flux-system/tenants Namespace: flux-system/app

+++ tests/testdata/cluster3/tenants/overlays/cluster3 Kustomization: flux-system/tenants Namespace: flux-system/app

@@ -0,0 +1,6 @@

+---
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: app
+
--- tests/testdata/cluster3/namespaces/overlays/cluster3 Kustomization: flux-system/namespaces Namespace: flux-system/podinfo

+++ tests/testdata/cluster3/namespaces/overlays/cluster3 Kustomization: flux-system/namespaces Namespace: flux-system/podinfo

@@ -0,0 +1,6 @@

+---
+apiVersion: v1
+kind: Namespace
+metadata:
+  name: podinfo
+

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

--- tests/testdata/cluster5 Kustomization: controllers/infra-controllers HelmRepository: flux-system/bitnami

+++ tests/testdata/cluster5 Kustomization: controllers/infra-controllers HelmRepository: flux-system/bitnami

@@ -0,0 +1,11 @@

+---
+apiVersion: source.toolkit.fluxcd.io/v1beta2
+kind: HelmRepository
+metadata:
+  name: bitnami
+  namespace: flux-system
+spec:
+  interval: 30m
+  type: oci
+  url: oci://registry-1.docker.io/bitnamicharts
+
--- tests/testdata/cluster5 Kustomization: controllers/infra-controllers HelmRepository: flux-system/weave-charts

+++ tests/testdata/cluster5 Kustomization: controllers/infra-controllers HelmRepository: flux-system/weave-charts

@@ -0,0 +1,10 @@

+---
+apiVersion: source.toolkit.fluxcd.io/v1beta2
+kind: HelmRepository
+metadata:
+  name: weave-charts
+  namespace: flux-system
+spec:
+  interval: 1h
+  url: https://helm.gitops.weave.works
+

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

no HelmRelease objects found in cluster

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

--- tests/testdata/cluster6/cluster HelmRelease: default/renovate ServiceAccount: default/renovate

+++ tests/testdata/cluster6/cluster HelmRelease: default/renovate ServiceAccount: default/renovate

@@ -0,0 +1,10 @@

+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: renovate
+  labels:
+    app.kubernetes.io/name: renovate
+    app.kubernetes.io/instance: renovate
+    app.kubernetes.io/managed-by: Helm
+
--- tests/testdata/cluster6/cluster HelmRelease: default/renovate CronJob: default/renovate

+++ tests/testdata/cluster6/cluster HelmRelease: default/renovate CronJob: default/renovate

@@ -0,0 +1,54 @@

+---
+apiVersion: batch/v1
+kind: CronJob
+metadata:
+  name: renovate
+  labels:
+    app.kubernetes.io/name: renovate
+    app.kubernetes.io/instance: renovate
+    app.kubernetes.io/managed-by: Helm
+spec:
+  schedule: 0 1 * * *
+  jobTemplate:
+    metadata:
+      labels:
+        app.kubernetes.io/name: renovate
+        app.kubernetes.io/instance: renovate
+    spec:
+      template:
+        metadata:
+          labels:
+            app.kubernetes.io/name: renovate
+            app.kubernetes.io/instance: renovate
+        spec:
+          serviceAccountName: renovate
+          restartPolicy: Never
+          containers:
+          - name: renovate
+            image: renovate/renovate:35.159.7
+            imagePullPolicy: IfNotPresent
+            env:
+            - name: RENOVATE_CONFIG_FILE
+              value: /dev/null
+            envFrom: null
+            securityContext:
+              allowPrivilegeEscalation: false
+              capabilities:
+                drop:
+                - ALL
+            resources:
+              limits:
+                cpu: 1000m
+                memory: 2G
+              requests:
+                cpu: 100m
+                memory: 256Mi
+          volumes: null
+          securityContext:
+            fsGroup: 1000
+            fsGroupChangePolicy: Always
+            runAsNonRoot: true
+            runAsUser: 1000
+            seccompProfile:
+              type: RuntimeDefault
+

Update logic for handling flux-system
Revert test changes
Add valid repositories for cluster5
Include flux-system in kustomization output
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

--- tests/testdata/cluster6/apps Kustomization: flux-system/apps HelmRepository: flux-system/renovate

+++ tests/testdata/cluster6/apps Kustomization: flux-system/apps HelmRepository: flux-system/renovate

@@ -0,0 +1,10 @@

+---
+apiVersion: source.toolkit.fluxcd.io/v1beta2
+kind: HelmRepository
+metadata:
+  name: renovate
+  namespace: flux-system
+spec:
+  interval: 30m
+  url: https://docs.renovatebot.com/helm-charts
+
--- tests/testdata/cluster6/apps Kustomization: flux-system/apps HelmRelease: default/renovate

+++ tests/testdata/cluster6/apps Kustomization: flux-system/apps HelmRelease: default/renovate

@@ -0,0 +1,40 @@

+---
+apiVersion: helm.toolkit.fluxcd.io/v2beta1
+kind: HelmRelease
+metadata:
+  name: renovate
+  namespace: default
+spec:
+  chart:
+    spec:
+      chart: renovate
+      sourceRef:
+        kind: HelmRepository
+        name: renovate
+        namespace: flux-system
+  interval: 5m
+  values:
+    renovate:
+      existingConfigFile: /dev/null
+      securityContext:
+        allowPrivilegeEscalation: false
+        capabilities:
+          drop:
+          - ALL
+    resources:
+      limits:
+        cpu: 1000m
+        memory: 2G
+      requests:
+        cpu: 100m
+        memory: 256Mi
+    securityContext:
+      fsGroup: 1000
+      fsGroupChangePolicy: Always
+      runAsNonRoot: true
+      runAsUser: 1000
+      seccompProfile:
+        type: RuntimeDefault
+    serviceAccount:
+      create: true
+
--- tests/testdata/cluster6/cluster Kustomization: flux-system/flux-system GitRepository: flux-system/flux-system

+++ tests/testdata/cluster6/cluster Kustomization: flux-system/flux-system GitRepository: flux-system/flux-system

@@ -0,0 +1,14 @@

+---
+apiVersion: source.toolkit.fluxcd.io/v1beta1
+kind: GitRepository
+metadata:
+  name: flux-system
+  namespace: flux-system
+spec:
+  interval: 1m0s
+  ref:
+    branch: main
+  secretRef:
+    name: flux-system
+  url: ssh://[email protected]/allenporter/flux-local
+
--- tests/testdata/cluster6/cluster Kustomization: flux-system/flux-system Kustomization: flux-system/apps

+++ tests/testdata/cluster6/cluster Kustomization: flux-system/flux-system Kustomization: flux-system/apps

@@ -0,0 +1,12 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  name: apps
+  namespace: flux-system
+spec:
+  path: ./tests/testdata/cluster6/apps/
+  sourceRef:
+    kind: GitRepository
+    name: flux-system
+
--- tests/testdata/cluster6/cluster Kustomization: flux-system/flux-system Kustomization: flux-system/flux-system

+++ tests/testdata/cluster6/cluster Kustomization: flux-system/flux-system Kustomization: flux-system/flux-system

@@ -0,0 +1,14 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
+kind: Kustomization
+metadata:
+  name: flux-system
+  namespace: flux-system
+spec:
+  interval: 10m0s
+  path: ./tests/testdata/cluster6/cluster
+  prune: true
+  sourceRef:
+    kind: GitRepository
+    name: flux-system
+

@allenporter allenporter merged commit 16092b9 into main Jul 7, 2023
21 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2023

no HelmRelease objects found in cluster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant